<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=9" />
		<meta http-equiv="pragma" content="no-cache" />
		<title>咨询互动信息</title>
		<%@ include file="../../common/Admin-list.jsp"%>  
		
		<script type="text/javascript" src="<%=bpath %>Scripts/jquery/jquery.form.js"></script> 			 
		<script type="text/javascript">	
		var IconSize=24; //一级 菜单 24 二级 32
		
		$(function(){
			$('#reply_org_id').combotree({
				 url:"../district/findByPidAll.json",
				 disabled:true,
				 onSelect:function(node)
				 {
					// alert(node.text);
				 },
				onLoadSuccess :function(){
			        $('#reply_org_id').combotree("setValue",'${data.advisoryMsg.reply_org_id}');//这里写设置默认值，
			    }
			    });
			
			
			
			//保存 
			$("#lnbSave").click(function(){		
				$("#addForm").ajaxSubmit({
					url:"../advisoryMsgController/reply.json",
					type:"POST",
					dataType:"json",
					beforeSubmit:checkForm,
					contentType:"application/x-www-form-urlencoded;charset=UTF-8",
					error:function(){},
					success:function(data){
						if(data.success==true){
							showTip("回复成功，返回列表页面！","succeed");	
							var win = artDialog.open.origin;//来源页面
							win.art.dialog({id: 'editReplyDialog'}).close();
							
						}else{
							art.dialog.alert('保存失败，请确认填写正确！');
						}
					},
				});
			});
		});
			
		function checkForm(){
			var flag=$('#addForm').form('validate');
			return true;
		}
				
		//消息提示  
		function showTip(mess,icon) {  
		    art.dialog({  
		        id : 'Tip',  
		        title : '消息',  
		        fixed : true,  
		        lock : true,  
		        opacity: .2,  
		        content : mess,  
		        icon : icon,  
		        time : 1  
		    });  
		    setTimeout('originReload()', 1000);  
		}  
		</script>
		
</head>
<body>
<!---->
<div>
	<div id="tab">
        <ul>
            <li class="Current">
            	<a href="#" onfocus="this.blur()">
            		<span id="lblTitle" >咨询留言--任务分派  </span>
            	</a>
            </li>
        </ul>
    </div>  
    <div id="menu">
        <ul>
            <li>
            	<a id="lnbSave">
            		<span><img src="<%=basePath %>pages/Admin/Images/Icon/save.gif" alt="Save" />保存</span>
            	</a>
            </li>
        </ul>
    </div>
    
    <div id="middle"> 
    <form action="../advisoryMsgController/reply.json" id="addForm" name="addForm" method="post"   enctype="multipart/form-data">   

   
    <div class="editor">
        <table class="eTable">
        
       
            <tr class="eTr">
                <td class="name">咨询主题:</td>
   				<td colspan="3">${data.advisoryMsg.topic }</td>
   			<td class="name">回复状态:</td>
   			<td> 
   				<c:if test="${data.advisoryMsg.is_reply =='0'}">  未回复</c:if>
   				<c:if test="${data.advisoryMsg.is_reply =='1'}">已回复</c:if>
   			</td>
   		</tr>
   		
   		<tr>
   			<td class="name">咨询人:</td>
   			<td> ${data.advisoryMsg.ad_name }</td>
   			
   			<td  class="name">咨询电话:</td>
   			<td>${data.advisoryMsg.ad_tel }</td>
   			
   			<td  class="name">咨询邮件:</td>
   			<td>${data.advisoryMsg.ad_email }</td>
   		</tr>
   		
   		<tr>
   			<td  class="name">咨询内容:</td>
   			<td colspan="5">${data.advisoryMsg.content }</td>
   		</tr>
        
            <tr class="eTr">
                <td class="name">
                    <label id="Label1" >回复机构:</label>
                </td>
                <td  colspan="5">
                	<select id="reply_org_id" name="reply_org_id" class="easyui-combotree"  style="width:250px;" ></select>
				</td>
            </tr>
        
            <tr class="eTr">
                <td class="name">
                    <label id="Label1" >回复内容:</label>
                </td>
                <td  colspan="5">
                	<input type="hidden" id="id" name="id" value="${data.advisoryMsg.id }"/>
            
					<textarea rows="5"  id="reply_content" name="reply_content">${data.advisoryMsg.reply_content}</textarea>
				</td>
            </tr>
           
        </table>
        <div id="iconDiv"><img id="imgIcon" /></div>
    </div>
    </form> 
    </div>
</div>
</body>
</html>